#ifndef SMTPTASKTHREAD_H
#define SMTPTASKTHREAD_H
#include <QThread>
#include <QQueue>
#include "../../b-model/03-smtp_task/smtptask.h"
#include "QtNetwork/QTcpSocket"

class SmtpTaskThread : public QThread
{
public:
    int port = 25;
    // QString server = "smtp.qq.com";
    // QString mailAccount = "hmtest1028@qq.com";
    // QString user = "hmtest1028";
    // QString password = "fxbbpojgpmpvcijj";
    QString server = "172.16.10.30";
    QString mailAccount = "ds03@jmtest.cn";
    QString user = "ds03@jmtest.cn";
    QString password = "admin123";
    QTcpSocket * mSocket;
    SmtpTaskThread();
    void run() override;
    QQueue<SmtpTask *> taskQueue = QQueue<SmtpTask *>();

    void addTask(SmtpTask * task);
    void executeTask(SmtpTask * task);
    void readSocketSync();
};

#endif // SMTPTASKTHREAD_H
